import request from '@/utils/request'

// 查询公告列表
export function fetchList(params) {
    return request({
        url: '/system/notice/list',
        method: 'get',
        params
    })
}

// 新增
export function noticeAdd(data) {
    return request({
        url: '/system/notice/add',
        method: 'post',
        headers: {
            "Content-Type": 'multipart/form-data'
        },
        data
    })
}

//详情
export function fetchPublicInfo(params) {
    return request({
        url: '/system/notice/getNoticeInfo',
        method: 'get',
        params
    })
}

//编辑
export function noticeEdit(data) {
    return request({
        url: '/system/notice/edit',
        headers: {
            "Content-Type": 'multipart/form-data'
        },
        method: 'post',
        data
    })
}

//发布
export function noticeUpdateStatus(data) {
    return request({
        url: '/system/notice/updateNoticeStatus',
        method: 'post',
        data
    })
}

//删除
export function noticeDelete(data) {
    return request({
        url: '/system/notice/remove',
        method: 'post',
        data
    })
}

//查询最新公告信息
export function fetchLatestNotice(params) {
    return request({
        url: '/system/notice/getLatestNotice',
        method: 'get',
        params
    })
}

//消息 公告列表
export function fetchPublicList(params) {
    return request({
        url: '/system/notice/getMyNotice',
        method: 'get',
        params
    })
}

//未读公告条数
export function fetchNoticeCount(params) {
    return request({
        url: '/system/notice/getNoticeCount',
        method: 'get',
        params
    })
}

//消息  公告详情
export function fetchInfoDetail(params) {
    return request({
        url: '/system/notice/getMyInfo',
        method: 'get',
        params
    })
}

//消息 全部已读
export function fetchAllRead(params) {
    return request({
        url: '/system/notice/getAllRead',
        method: 'get',
        params
    })
}